package com.xiaozhameng.bootstudy.web;

import com.xiaozhameng.bootstudy.all.connectionpooltest.PoolSizeDemo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class HelloController {

    @Resource
    private PoolSizeDemo poolSizeDemo;

    @RequestMapping("/hello")
    public String handle01(){
        return "Hello, Spring Boot 2!";
    }


    @RequestMapping("/poolSizeDemo")
    public String poolSizeDemo(){
        try {
            poolSizeDemo.syncData();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "Hello, poolSizeDemo";
    }
}